const http = require('node:http')
const url = require('node:url')

http.createServer((req,res)=>{
    const {pathname} = url.parse(req.url, true)
    if(pathname === '/api'){
        res.setHeader('Content-Type', "application/json")
        res.statusCode = 200
        res.end('proxy success')
    }
}).listen(3000,()=>{
    console.log('服务启动成功，端口号3000')
})